/*
 * @Description: 速度信息订阅，包装到TwistStamped
 * @Author: Sang Hao
 * @Date: 2021-10-26 11:52:26
 * @LastEditTime: 2021-10-27 13:39:34
 * @LastEditors: Sang Hao
 */

#ifndef LIDAR_SLAM_SUBSCRIBER_VELOCITY_SUBSCRIBER_HPP_
#define LIDAR_SLAM_SUBSCRIBER_VELOCITY_SUBSCRIBER_HPP_

#include <deque>
#include <ros/ros.h>
#include "geometry_msgs/TwistStamped.h"
#include "lidar_slam/sensor_data/velocity_data.hpp"

namespace lidar_slam {
class VelocitySubscriber {
public:
    VelocitySubscriber(ros::NodeHandle& nh, std::string topic_name, size_t buff_size);
    VelocitySubscriber() = default;
    void ParseData(std::deque<VelocityData>& deque_velocity_data);

private:
    void msg_callback(const geometry_msgs::TwistStampedConstPtr& twist_msg_ptr);

private:
    ros::NodeHandle nh_;
    ros::Subscriber subscriber_;

    std::deque<VelocityData> new_velocity_data_; 
};
}
#endif